﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;


namespace Jewelnoid
{
    class Block : Object2D
    {
        static public Dictionary<int, Color> numberColorMap = new Dictionary<int, Color>
                {
	                {1, Color.Blue},
	                {2, Color.Yellow},
	                {3, Color.Red},
	                {4, Color.Green},
	                {5, Color.Purple},
	                {6, Color.Orange},
	                {7, Color.White}
                };

        static public Dictionary<Color, int> colorNumberMap = new Dictionary<Color, int>
                {
	                {Color.Blue, 1},
	                {Color.Yellow, 2},
	                {Color.Red, 3},
	                {Color.Green, 4},
	                {Color.Purple, 5},
	                {Color.Orange, 6},
	                {Color.White, 7}
                };

        public Color color;

        public Block(Texture2D texture, Vector2 position, Color color) :
            base(texture, position, color)
        {
            this.color = color;
        }

        public int getPoints()
        {
            return (colorNumberMap[color] + 1) * 10;   // Exemplo: Azul = 20 pontos, Branco = 80
        }

        static public Color nextColor(Color color)
        {
            int colorNumber = colorNumberMap[color];

            if (colorNumber != 7)
            {
                return numberColorMap[colorNumber + 1];
            }

            return numberColorMap[1];
        }
    }
}
